package com.ajcorp.main;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import javax.swing.Box.Filler;

import org.supercsv.io.CsvBeanWriter;
import org.supercsv.prefs.CsvPreference;
import com.ajcorp.common.Helper;

public class MainClass {

	public static void main(String args[]) throws IOException
	{
		
		boolean displayheader = false;
		
		//System.out.println("Hello World");
		List simplepojolist = new ArrayList <SimplePOJO>();
		
		SimplePOJO objSimplePojo1 = new SimplePOJO("Nishant",29,"Address of Nishant");
		SimplePOJO objSimplePojo2 = new SimplePOJO("John",30,"Address of John");
		SimplePOJO objSimplePojo3 = new SimplePOJO("Ravi",31,"Address of Ravi");
		SimplePOJO objSimplePojo4 = new SimplePOJO("Amit",18,"Address of Amit");

		simplepojolist.add(objSimplePojo1);
		simplepojolist.add(objSimplePojo2);
		simplepojolist.add(objSimplePojo3);
		simplepojolist.add(objSimplePojo4);
		
		// Super CSV Stress Test -- Started --  
		SimplePOJO objdynamicpojo = null;
		for(int idx=0;idx<1000000; idx++)
		{
			objdynamicpojo = new SimplePOJO("Name"+idx,(10+idx), "Address of var"+idx+" ");
			simplepojolist.add(objdynamicpojo);
		}
		
		simplepojolist.add(new SimplePOJO("Last Record ",99,"last address"));
		
		// Super CSV Stress Test -- Finished --
		
		Helper.generateCSV(simplepojolist);
		
		System.out.println("CSV generation finished.");
	}
}